/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.curator.framework.recipes.locks;

import java.io.Closeable;
import java.io.IOException;

/**
 * 表示对象租约，从InterProcessSemaphore获取，当不需要使用租约是客户端需要关闭它，以便被其他客户端使用，
 * 客户端崩溃或者session过期租约自动关闭
 */
public interface Lease extends Closeable {

    /**
     * 释放租约，以便其他客户端获取
     */
    @Override
    public void close() throws IOException;

    /**
     * 返回租约存储在节点上的数据
     */
    public byte[] getData() throws Exception;
}
